<?php $this->load->view('layout/lottery/header') ?>
<div class="lotteryMain">
	<div class="panel panel-default panel-statistics">
		<div class="panel-heading">抽奖人数统计 <?php echo strtoupper('Statistics on the number of lottery') ?></div>
		<div class="panel-body">
	  		<form class="form-horizontal form-search" action="<?php echo site_url('lottery/userLottery'); ?>" method="get">
	  			<div class="clearfix form-text">
					<div class="form-group clearfix">
					    <label class="control-label">用户名</label>
					    <input type="text" class="form-control txt" placeholder="请输入中奖者姓名" name="user_name" value="<?php echo $this->input->get('user_name'); ?>">
					</div>
					<div class="form-group clearfix time">
					    <label class="control-label">抽奖时间</label>
					    <span><input type="text" name="startDate" value="<?php echo $this->input->get('startDate'); ?>" class="form-control txt" placeholder="开始时间" onclick="calendar.show({ id: this })" readonly="readonly" /></span>
					    <span>&nbsp;至&nbsp;</span>
					    <span><input type="text" name="endDate" class="form-control txt" value="<?php echo $this->input->get('endDate'); ?>" placeholder="结束时间" onclick="calendar.show({ id: this })" readonly="readonly" /></span>
					</div>
				</div>
				<div class="clearfix form-btns">
					<input type="submit" value="搜索" class="btn btn-submit" />
					<input type="reset" value="重置条件" class="btn btn-gray" />
				</div>
			</form>
		</div>
	</div>

	<div class="lotteryList">
		<?php if ($all_rows > 0) : ?>
		<table class="table table-striped mytable-striped">
			<thead>
				<tr>
					<th width="150">用户名</th>
					<th width="120">总共参与抽奖次数</th>
					<th width="120">累计中奖次数</th>
					<th width="120">累计抽奖次数</th>
					<th>活跃情况</th>
				</tr>
			</thead>
			<tbody>
				<?php foreach($page_list->result() as $value) : ?>
				<tr>
					<td class="user-info"><?php echo mb_substr($value->user_name, 0, 1), '***', mb_substr($value->user_name, -1, 1); ?></td>
					<td class="user-type"><?php echo $value->count; ?></td>
					<td class="user-type"><?php echo $value->weightTotal; ?></td>
					<td class="num"><?php echo ($value->todayTotal - $value->numTotal); ?></td>
					<td class="user-state">
						<p>最近抽奖时间：<?php echo $value->created_at; ?></p>
					</td>
				</tr>
				<?php endforeach; ?>
			</tbody>
		</table>
		<?php $this->load->view('layout/pagination') ?>
		<?php else :?>
            <div class="no-data">
                <img src="skins/images/panda.jpg"/>
                <p>没有搜索到结果</p>
            </div>
        <?php endif;?>
	</div>
</div>

<?php $this->load->view('layout/lottery/footer') ?>